Other Functions
The following functions are available globally.
-
Creates a new
See moreNSError
object from aPTPDFNetException
.Declaration
Objective-C
extern NSError *_Nonnull PTPDFNetExceptionToError( PTPDFNetException *_Nonnull exception)
Swift
func PTPDFNetExceptionToError(_ exception: PTPDFNetException) -> any Error
Parameters
exception
The exception.
Return Value
A new
NSError
object initialized with the exception’s information.
-
Returns the extended annotation type for the given name.
See moreDeclaration
Objective-C
extern PTExtendedAnnotType PTExtendedAnnotTypeFromName(PTExtendedAnnotName _Nullable name)
Swift
func PTExtendedAnnotTypeFromName(_ name: PTExtendedAnnotName?) -> PTExtendedAnnotType
Parameters
name
the annotation type name
Return Value
the corresponding extended annotation type, or
PTExtendedAnnotTypeUnknown
if the name is not known -
Returns the annotation name for the given extended annotation type.
See moreDeclaration
Objective-C
extern PTExtendedAnnotName _Nullable PTExtendedAnnotNameFromType( PTExtendedAnnotType type)
Swift
func PTExtendedAnnotNameFromType(_ type: PTExtendedAnnotType) -> PTExtendedAnnotName?
Parameters
type
the extended annotation type
Return Value
the corresponding annotation name, or
nil
if the annotation type is not known -
Returns a localized display name for the given extended annotation type.
See moreDeclaration
Objective-C
extern NSString *_Nullable PTLocalizedAnnotationNameFromType( PTExtendedAnnotType type)
Swift
func PTLocalizedAnnotationNameFromType(_ type: PTExtendedAnnotType) -> String?
Parameters
type
the extended annotation type
Return Value
the localized display name, or
nil
if the annotation type is not known -
Declaration
Objective-C
extern Class _Nullable PTAnnotClassForAnnot(PTAnnot *_Nonnull annotation)
Swift
func PTAnnotClassForAnnot(_ annotation: PTAnnot) -> AnyClass?
Parameters
annotation
the annotation
Return Value
the most derived
PTAnnot
subclass for the specified annotation, ornil
if the class cannot be determined -
Declaration
Objective-C
extern Class _Nullable PTWidgetClassForWidgetAnnot(PTWidget *_Nonnull widget)
Swift
func PTWidgetClassForWidgetAnnot(_ widget: PTWidget) -> AnyClass?
Parameters
widget
the widget annotation
Return Value
the most derived
PTWidget
subclass for the specified widget annotation, ofnil
if the class cannot be determined -
Undocumented
See moreDeclaration
Objective-C
static inline BOOL PTPDFPageNumberIsValid(PTPDFPageNumber pageNumber) { return pageNumber != PTInvalidPDFPageNumber; }
Swift
func PTPDFPageNumberIsValid(_ pageNumber: PTPDFPageNumber) -> Bool
-
Use the default
See morePTAnalyticsManager
to log the given exception.Declaration
Objective-C
extern void PTLogException(NSException *_Nonnull exception, NSDictionary<id, id> *_Nullable extraData)
Swift
func PTLogException(_ exception: NSException, _ extraData: [AnyHashable : Any]?)
Parameters
exception
the exception to log
extraData
extra information to pass along with the exception
-
Use the default
See morePTAnalyticsManager
to log the given event.Declaration
Objective-C
extern void PTLogAnalyticsEvent(PTAnalyticsEventCategory _Nullable category, NSString *_Nonnull eventDescription, ...)
Parameters
eventDescription
The format-string for the event description.
...
A comma-separated list of arguments to substitute into
eventDescription
. -
Converts a
See moreCGLineJoin
enumeration value to the correspondingPTLineJoin
value.Declaration
Objective-C
extern PTLineJoin PTLineJoinFromCGLineJoin(CGLineJoin lineJoin)
Swift
func PTLineJoinFromCGLineJoin(_ lineJoin: CGLineJoin) -> PTLineJoin
Parameters
lineJoin
The value to be converted
Return Value
the corresponding
PTLineJoin
value -
Returns a localized version of a string, using the Tools bundle.
See moreDeclaration
Objective-C
extern NSString *_Nonnull PTLocalizedString(NSString *_Nonnull key, NSString *_Nullable comment)
Swift
func PTLocalizedString(_ key: String, _ comment: String?) -> String
-
Returns a localized version of a string from the specified table, using the Tools bundle.
See moreDeclaration
Objective-C
extern NSString *_Nonnull PTLocalizedStringFromTable( NSString *_Nonnull key, NSString *_Nullable table, NSString *_Nullable comment)
Swift
func PTLocalizedString(key: String, table: String?, comment: String?) -> String
-
Returns the corresponding non-continuous page presentation mode for the given mode. If the mode is already non-continuous then the input mode is returned.
See moreDeclaration
Objective-C
extern TrnPagePresentationMode PTPagePresentationModeGetBaseMode(TrnPagePresentationMode mode)
Swift
func PTPagePresentationModeGetBaseMode(_ mode: TrnPagePresentationMode) -> TrnPagePresentationMode
Parameters
mode
the page presentation mode
Return Value
the corresponding non-continuous page presentation mode
-
Returns whether the given page presentation mode is continuous.
See moreDeclaration
Objective-C
extern BOOL PTPagePresentationModeIsContinuous(TrnPagePresentationMode mode)
Swift
func PTPagePresentationModeIsContinuous(_ mode: TrnPagePresentationMode) -> Bool
Parameters
mode
the page presentation mode
Return Value
YES
if the page presentation mode is continuous,NO
otherwise -
This function is used to toggle the continuous aspect of a page presentation mode. For the specified page presentation mode, a corresponding mode will be returned with the continuous aspect added or removed according to the
See morecontinuous
parameter.Declaration
Objective-C
extern TrnPagePresentationMode PTPagePresentationModeGetEffectiveMode(TrnPagePresentationMode mode, BOOL continuous)
Swift
func PTPagePresentationModeGetEffectiveMode(_ mode: TrnPagePresentationMode, _ continuous: Bool) -> TrnPagePresentationMode
Parameters
mode
the page presentation mode
continuous
YES
if the resulting page presentation mode should be continuous,NO
otherwiseReturn Value
the corresponding page presentation mode with the continuous aspect added or removed according to the
continuous
parameter.